#ifndef _IIC_H__
#define _IIC_H__

#include <STC15F2K60S2.H>
#include "intrins.h"

#define uchar unsigned char 
#define uint unsigned int

#define DELAY_TIME 5

//IIC引脚定义
sbit IIC_SDA = P2^1;  //数据线
sbit IIC_SCL = P2^0;  //时钟线

//读写IIC的操作寄存器地址宏定义
#define SlaveAddrW 0xA0
#define SlaveAddrR 0xA1

void IIC_Start(void); 
void IIC_Stop(void); 
void IIC_SendAck(bit AckBit);
bit  IIC_WaitAck(void); 
void IIC_SendByte(unsigned char byt);  
unsigned char IIC_RecByte(void);

unsigned char PCF8591_ADC_Read(unsigned char address);


#endif
